package org.phmanago.core;

import java.util.Iterator;
import java.util.LinkedList;

public class Album {
	private LinkedList<Node> nodes;
	
	private String albumName = null;
	public Album() {

	}
	
	public Album(String n) {
		albumName = n;
	}
	
	public void addNewNode(Node n) {
		if (nodes == null)
			nodes = new LinkedList<Node>();
		
		nodes.add(n);
	}
	
	public Iterator getNodes() {
		return nodes.iterator();
	}
	
	public void addNodeAttribute(Node n, Attribute a) {
		n.addAttribute(a);
	}
	
	public String toString() {
		String s = "";
		
		s += albumName.toUpperCase() + "\n";
		
		Iterator it = getNodes();
		while (it.hasNext()) {
			Node n = (Node)it.next();
			s += n.toString() + "\n";
		}
		return s;
	}
	
	public String getName() {
		return albumName;
	}
}
